#include <QtGui>
#include "about.h"

AboutDialog::AboutDialog(QWidget *parent)
     : QDialog(parent)
 {
    setSizeGripEnabled(true);
    setModal(true);
    setWindowTitle(tr("About Chinese Cheese"));
    this->setToolTip(tr("This ia a 'About'"));
    setFixedSize(600,200);

    label = new QLabel(tr(""));
    label->setGeometry(QRect(0, 70, 561, 51));
    label->setFrameStyle(QFrame::Panel | QFrame::Sunken);
    label->setAutoFillBackground(true);
    QFont font("wenquanyi",20,QFont::Bold ,FALSE);
    label->setFont(font);
    label->setText("Chinese Cheese Ver.1.0\nMade by 'li.chen@tieto.com'");
    label->setAlignment(Qt::AlignCenter);

    QHBoxLayout *center = new QHBoxLayout;
    center->addWidget(label);

    okButton = new QPushButton(tr("OK"));
    okButton->setDefault(true);
    okButton->setEnabled(true);
    okButton->setGeometry(QRect(460, 150, 75, 23));

    connect(okButton, SIGNAL(clicked()),
           this, SLOT(okClicked()));

    QHBoxLayout *btnLayout = new QHBoxLayout;
    btnLayout->insertSpacing(1,500);
    btnLayout->addWidget(okButton);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addLayout(center);
    mainLayout->addLayout(btnLayout);
    setLayout(mainLayout);
}

void AboutDialog::okClicked()
{
  this->close();
}



